Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: improve performance and functionality #1

Merged
merged 2 commits into from
Dec 3, 2023

Conversation

ssttehrani
Copy link
Contributor

Summary
This pull request introduces crucial refactoring in our system, aiming to enhance performance and efficiency. It encompasses the implementation of an in-memory cache for namespace exclusion status, improvements in service exposure handling through MetalLB annotation checks, and updates to the latest cilium Go package.

Key Changes

  • In-Memory Cache for Namespace Exclusion:
    Implemented an in-memory cache to more efficiently determine the exclusion status of namespaces.
    This optimization supersedes the less efficient method that involved list operations on ciliumNetworkPolicy and networkPolicy, as well as get operation on event namespace in each reconcile loop.

  • Service Exposure Handling via MetalLB Annotation:
    Integrated functionality to assess the metallb.universe.tf/address-pool: vpn-access annotation in Service objects.
    This assessment dictates whether a service should be exposed, subsequently appending the required rule to its associated CiliumNetworkPolicy object, thus enhancing our service-level operation handling.

  • Cilium Go Package Update:
    The cilium Go package has been updated to align with the latest changes. This update is crucial for maintaining compatibility and enhancing overall performance.

Impact
These improvements are directed at refining the process for namespace status checks and service exposure decisions. By implementing these changes, we anticipate a boost in operation efficiency and a reduction in resource usage.

- Designed and implemented an in-memory cache to determine namespace exclusion status. This optimization replaces the previous, less efficient method of performing list operations on ciliumNetworkPolicy and networkPolicy, as well as get operations on event namespace in each reconcile loop.
- Added functionality to check the MetalLB annotation `metallb.universe.tf/address-pool: vpn-access` in Service objects. This determines if a service should be exposed, and if so, adds the necessary rule to its associated CNP object. This change enhances service-level operation handling.
- Updated the cilium Go package to integrate with the latest changes, ensuring compatibility and improved performance.
@ssttehrani ssttehrani merged commit 29a71b9 into snapp-incubator:main Dec 3, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant